package com.timi_licai.timi_licai_account.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.timi_licai.timi_licai_account.R;

import java.util.List;

/**
 * 数值输入键盘的Adapter
 */
public class AddAdapter extends BaseAdapter {
    private Context context;
    private List<String> numList;

    public AddAdapter(Context context, List<String> numList) {
        this.context = context;
        this.numList = numList;
    }

    @Override
    public int getCount() {
        return numList.size();
    }

    @Override
    public Object getItem(int position) {
        return numList.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View view = LayoutInflater.from(context).inflate(R.layout.item_recycle, parent, false);
        TextView numTxt = (TextView) view.findViewById(R.id.txt_num);
        numTxt.setText(numList.get(position));
        view.setTag("numGirdView");
        return view;
    }
}
